#ifndef _SERVER_TOOLS_H
#define _SERVER_TOOLS_H

#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "server_typedef.h"
#include "server_log.h"
#include <wchar.h>
#include "time.h"
#include "server_assert.h"

// =========================字符串工具=========================
typedef enum _StringIsSensitive { // 字符串是否大小写敏感
    STRING_CASE_SENSITIVE = 0, // 区分大小写
    STRING_CASE_INSENSITIVE, // 不区分大小写
} StringIsSensitive;


// =========================日期工具=========================
typedef struct _ServerDate {
    uint16 year;  // 年
    uint8  month; // 月
    uint8  day;   // 日
} ServerDate;

// =========================字符串工具=========================
uint8 server_string_is_in(wchar_t * str, wchar_t * sub_str, StringIsSensitive is_sensitive);

// =========================日期工具=========================
uint8   is_leap_year(uint16 year);
uint8   get_days_in_month(uint16 year, uint8 month);
uint32  date_to_days(ServerDate * date);

void    server_get_current_date(ServerDate * date);
uint32  server_calc_date_difference(ServerDate * date_from, ServerDate * date_to);

#endif 
